// ===================================
// <copyright>
// This file is part of LABSMFController.
//
//    LABSMFController is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    LABSMFController is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with LABSMFController.  If not, see <http://www.gnu.org/licenses/>.
//    Copyright 2011 David Bakker
//
//</copyright>
// <author>David Bakker</author>
// <email>mailto:DavidFBakker@gmail.com</email>
// <created>Saturday, May 07, 2011</created>
// <lastedit>Saturday, May 07, 2011</lastedit>
// ===================================

using LABSMFController.LABS.Classses;
using LABSMFController.LABS.Devices;

namespace LABSMFController.LABS.Steps
{


    public class PumpStepClass
    {
        internal PumpStepClass(string name, string description)
        {
           
            WaterMovements =new WaterMovementClass[BeerDevices.MAXSteps];
            Name = name;
            Description = description;           

            DurationToRun = 0;            
            Header = "Description,IsActive,BubblerID,BubblerGallons,Name";
        }

        public string Name { get; private set; }
        public string Header { get; set; }     
       
        public WaterMovementClass[] WaterMovements { get; set; }
      
        public bool IsActive { get; set; }
        public bool MatchRates { get; set; }

        public string ConflictsWith { get; set; }
        
        public double DurationToRun { get; internal set; }               

        public string Description { get; set; }        

        public string GetClientOutPut()
        {
            string[] c = ConflictsWith.Split(',');
            string rr = c[0];
            for (int index = 1; index < c.Length; index++)
            {
                string t = c[index];
                rr = rr + "_" + t;
            }

            string ret = Description + "," + IsActive + ","  + Name + "," +"," + rr;
            return ret;
        }


        //public static string GetStepsClientOutPut()
        //{
        //    string ret = "HEADER:Steps:" + BeerSteps.Steps[0].Header + ";";
        //    for (int c = 0; c < MAXSteps; c++)
        //    {
        //        if (BeerSteps.Steps[c] != null)
        //            ret = ret + "\r\n" + BeerSteps.Steps[c].GetClientOutPut() + ";";
        //    }
        //    return ret;
        //}

     
      
    }

   
}